package com.demo.boss.common.convert;


import com.demo.boss.entity.UserInfo;
import com.demo.boss.models.vo.UserInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,uses = {MapperHelper.class}) // uses:表示需要使用的类
public interface UserConvert {
    @Mappings({
            @Mapping(source = "createTime",target = "createTime",dateFormat = "yyyy-MM-dd HH:mm"),
            @Mapping(source = "status",target = "status",qualifiedByName = "translateStatus")
    })
    UserInfoVo mapInfoVo(UserInfo userInfo);
    List<UserInfoVo> convertListInfoVo(List<UserInfo> userInfoList);
}
